package com.xnx3.banmahuishou.core.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.xnx3.j2ee.entity.BaseEntity;


/**
 * 积分变更记录表
 * @author zxy
 */
@Entity()
@Table(name = "laji_score_change_record")
public class ScoreChangeRecord extends BaseEntity implements java.io.Serializable{

	/**
	 * 积分获得类型  1 签到积分
	 */
	public static final Integer TYPE_QIANDAO = 1;
	/**
	 * 积分获得类型  2 抽奖积分 
	 */
	public static final Integer TYPE_CHOUJIANG = 2;
	/**
	 * 积分获得类型  3 下单返积分
	 */
	public static final Integer TYPE_XIADAN = 3;
	/**
	 * 积分获得类型  4 邀请新人获得积分 
	 */
	public static final Integer TYPE_LAXIN = 4;
	/**
	 * 积分获得类型  5 评价积分 
	 */
	public static final Integer TYPE_PINGJIA = 5;
	
	private Integer id;	//自增id
	private Integer userid;	//用户id,关联user.id
	private Integer addTime;	//记录添加时间, 十位数时间戳
	private Integer changePoints;	//变更积分数目
	private String remarks;	//变更备注, 什么时候干什么获得或者消耗积分多少,相关的记录id是什么
	private String title;	//变更标题, 比如: 第几次签到获得, 用于变更记录展示使用
	private Integer type;	//类型,1: 签到, 2: 抽奖 3: 下单 4: 拉新 5: 评价
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "userid", columnDefinition="int(11) COMMENT '用户id,关联user.id' default '0'")
	public Integer getUserid() {
		return userid;
	}
	public void setUserid(Integer userid) {
		this.userid = userid;
	}
	@Column(name = "add_time", columnDefinition="int(11) COMMENT '签到时间,十位数时间戳' default '0'")
	public Integer getAddTime() {
		return addTime;
	}
	public void setAddTime(Integer addTime) {
		this.addTime = addTime;
	}
	
	@Column(name = "change_points", columnDefinition="int(11) COMMENT '变更积分数目' default '0'")
	public Integer getChangePoints() {
		return changePoints;
	}
	public void setChangePoints(Integer changePoints) {
		this.changePoints = changePoints;
	}
	
	@Column(name = "remarks", columnDefinition="char(200) COLLATE utf8mb4_unicode_ci COMMENT '变更备注, 什么时候干什么获得或者消耗积分多少,相关的记录id是什么' default ''")
	public String getRemarks() {
		return remarks;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	@Column(name = "title", columnDefinition="char(60) COLLATE utf8mb4_unicode_ci COMMENT '变更标题, 比如: 第几次签到获得, 用于变更记录展示使用' default ''")
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name = "type", columnDefinition="int(3) COMMENT '类型,1: 签到, 2: 抽奖 3: 下单 4: 拉新 5: 评价' default '0'")
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	
	@Override
	public String toString() {
		return "ScoreChangeRecord [id=" + id + ", userid=" + userid + ", addTime=" + addTime + ", changePoints="
				+ changePoints + ", remarks=" + remarks + ", title=" + title + ", type=" + type + "]";
	}

	
}
